// @ts-ignore
import appConfig from 'app.config'
/* vue */
import { computed, ComputedRef } from 'vue'

export type EnvType = {
  isDev: ComputedRef<boolean>
}

/** 
 * @description 是否为开发环境
*/
function isDevelopmentEnv() {
  return appConfig.env.indexOf('prod') < 0
}

export function useEnv(): EnvType {
  const isDev = computed(() => isDevelopmentEnv())
  
  return {
    isDev
  }
}
